#include "test_cyclequeue.h"
#include "cm_uart.h"
#include "cm_demo_uart.h"


static cm_cyclequeue_t ptCycleQueue = {0};
static uint8_t pu8Buf[1024] = {0};
static uint32_t u32BufLen = 1024;
void cm_test_cyclequeue_operation(unsigned char*cmd[],int len)
{
    if(0 == strcmp("CREAT",cmd[2]))
    {
        cm_cyclequeue_create(&ptCycleQueue,pu8Buf,u32BufLen);
        cm_demo_printf("cm_cyclequeue_create no ret.\n");
    }
    else if(0 == strcmp("INSERT",cmd[2]))
    {
        // const uint8_t* pcu8Data = cmd[3];
        // uint32_t u32DataLen = strlen(cmd[3]);
        // uint32_t ret = cm_cyclequeue_insert(&ptCycleQueue,pcu8Data,u32DataLen);
        // cm_demo_printf("cm_cyclequeue_insert ret:%d\n",ret);
        // OCTEST_FUNC_EXPECT_EQUAL_INT32(u32DataLen,ret,cm_cyclequeue_insert);
    }
    else if(0 == strcmp("RELEASE",cmd[2]))
    {
        cm_cyclequeue_release(&ptCycleQueue);
        cm_demo_printf("cm_cyclequeue_release no ret.\n");
    }
    else if(0 == strcmp("CLEAN",cmd[2]))
    {
        cm_cyclequeue_clean(&ptCycleQueue);
        cm_demo_printf("cm_cyclequeue_clean no ret.\n");
    }
    else if(0 == strcmp("DELETE",cmd[2]))
    {
        // uint8_t pu8Buf[101] = {0};
        // uint32_t u32BufLen = 100;
        // uint32_t pu32RemainLen = 0;
        // uint32_t ret = cm_cyclequeue_delete(&ptCycleQueue, pu8Buf,u32BufLen,&pu32RemainLen);
        // cm_demo_printf("cm_cyclequeue_delete ret:%d\n",ret);
        // cm_demo_printf("data:%s\n",pu8Buf);
        // OCTEST_FUNC_EXPECT_GREATER_OR_EQUAL_INT32(0,ret,cm_cyclequeue_delete);
        // OCTEST_EXPECT_GREATER_OR_EQUAL_INT32(0,pu32RemainLen);
    }
    else{
        cm_demo_printf("param error!\n");
    }
}